package zb.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import zb.blog.base.bean.Result;
import zb.blog.base.global.GlobalVar;
import zb.blog.dao.AboutMeDao;
import zb.blog.service.IAboutMeService;

import java.util.Map;

@Service
public class AboutMeService implements IAboutMeService {
    @Autowired
    private AboutMeDao aboutMeDao;

    @Override
    public Result getArticleByType(Integer type) {
        Result res = new Result();
        Map<String, Object> map = aboutMeDao.getArticleByType(type);
        if (map != null) {
            res.setMsg("查询信息成功！");
            res.setData(map);
            res.setSuccess(GlobalVar.SUCCESS);
        } else {
            res.setMsg("加载信息失败！");
            res.setSuccess(GlobalVar.SUCCESS);
        }
        return res;
    }
}
